<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username')->unique()->comment('用户名');
            $table->string('password')->comment('密码');
            $table->string('duties')->nullable()->comment('职务');
            $table->string('describe')->nullable()->comment('描述');
            $table->string('rank')->nullable()->comment('职级');
            $table->string('salary')->nullable()->comment('薪水');
            $table->unsignedInteger('frame_id')->default(0)->comment('所属职级');
            $table->unsignedTinyInteger('type')->default(1)->comment('用户类别');
            $table->unsignedInteger('sex')->default(3)->comment('性别 1男,2女,3不详');
            $table->timestamp('birthday')->nullable()->comment('生日');
            $table->string('native')->nullable()->comment('籍贯');
            $table->string('card_id')->nullable()->comment('身份证号');
            $table->string('graduation_time')->nullable()->comment('毕业时间');
            $table->tinyInteger('education')->default(2)->comment('学历：1大专 2本科 3硕士 4博士');
            $table->string('major')->nullable()->comment('专业');
            $table->string('phone')->nullable()->comment('电话');
            $table->string('email')->nullable()->comment('Email');
            $table->string('wechat')->nullable()->comment('微信');
            $table->string('mac')->nullable()->comment('MAC地址');
            $table->unsignedInteger('mac_uid')->nullable()->index()->comment('MAC地址最后修改人');
            $table->unsignedInteger('mac_time')->nullable()->index()->comment('MAC地址最后修改时间');
            $table->unsignedInteger('download')->default(0)->index()->comment('下载量');
            $table->tinyInteger('status')->default(1)->index()->comment('状态：-1删除，0审核/禁用，1启用');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
